package org.example.chapter4.aspect.main;

import org.example.chapter4.aspect.MyAspect;
import org.example.chapter4.aspect.MyAspect1;
import org.example.chapter4.aspect.MyAspect2;
import org.example.chapter4.aspect.MyAspect3;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

/**
 * @author CoderXshuai
 * @date 2020/7/26/0026 18:35
 */
@SpringBootApplication(scanBasePackages = {"org.example.chapter4.aspect"})
public class Chapter4Application {
    //启动SpringBoot
    public static void main(String[] args) {
        SpringApplication.run(Chapter4Application.class, args);
    }

    //定义切面
    @Bean(name = "myAspect")
    public MyAspect initMyAspect() {
        return new MyAspect();
    }

    //定义切面
    @Bean(name = "MyAspect1")
    public MyAspect1 initMyAspect1() {
        return new MyAspect1();
    }

    //定义切面
    @Bean(name = "MyAspect2")
    public MyAspect2 initMyAspect2() {
        return new MyAspect2();
    }

    //定义切面
    @Bean(name = "MyAspect3")
    public MyAspect3 initMyAspect3() {
        return new MyAspect3();
    }
}
